﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TJ_MainNameSpace
{
    public partial class Form_Line : Form
    {
        public static Color lineC;
        public static int lineWidth;
        private kongjian31.hengjiexian10kv _lineH = null;
        private kongjian32.shujiexian10kv _lineV = null;
        public Form_Line(kongjian31.hengjiexian10kv p_Line)
        {
            _lineH = p_Line;
            InitializeComponent();
        }

        public Form_Line(kongjian32.shujiexian10kv p_Line)
        {
            _lineV = p_Line;
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            switch (this.comboBox1.Text)
            {
                case "1":
                    lineWidth = 1;
                    break;
                case "2":
                    lineWidth = 2;
                    break;
                case "4":
                    lineWidth = 4;
                    break;
                case "8":
                    lineWidth = 8;
                    break;
                default:
                    lineWidth = 1;
                    break;
            }
            switch (this.comboBox2.Text)
            {
                case "35KV":
                    lineC = Color.Red;
                    break;
                case "10KV":
                    lineC = Color.Yellow;
                    break;
                case "400V":
                    lineC = Color.Turquoise;
                    break;
                default:
                    lineC = Color.Red;
                    break;
            }
            if (_lineH == null)
            {
                _lineV.LineColor = lineC;
                _lineV.LineWidth = lineWidth;
            }
            else
            {
                _lineH.LineColor = lineC;
                _lineH.LineWidth = lineWidth;
            }
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

    }
}